<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>我的店铺</title>
      <script type="text/javascript">      
      //根据屏幕大小及dpi调整缩放和大小
      (function() {
          var scale = 1.0;
          var ratio = 1;
          if (window.devicePixelRatio >= 2) {
              scale *= 0.5;
              ratio *= 2;
          }
          var text = '<meta name="viewport" content="initial-scale=' + scale + ', maximum-scale=' + scale +', minimum-scale=' + scale + ', width=device-width, user-scalable=no" />';
          document.write(text);
          document.documentElement.style.fontSize = 50*ratio + "px";
      })();  
      </script>
      <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />      
      <meta http-equiv="Pragma" content="no-cache" />      
      <meta http-equiv="Expires" content="0" />
      <link rel="stylesheet" href="./public/css/reset.css">
      <link rel="stylesheet" href="./public/css/common.css">
      <link rel="stylesheet" href="./public/css/myshop.css">
  </head>
  <body>
    <div class="my-shop-page dn"  id="myshop">
      <template v-if="shopInfo">
        <div class="my-shop-info">
            <div class="shop-img">
              <img :src="'https://admin.buerxi.com'+shopInfo.shop_pic" id="J_pic">
            </div>
            <div class="info">
              <template v-if="shopInfo.role === '店长'">
                <div class="duty" v-if="onWork == 1" @click="toggleWork(1)">我要下班</div>
                <div class="duty b_red" v-if="onWork == 0" @click="toggleWork(0)">我要上班</div>
              </template>              
              <div class="name">
                {{shopInfo.name}}
              </div>
              <div class="position">                
                {{shopInfo.address}}
              </div>
              <div class="address">
                {{shopInfo.shop_parent_name}}
              </div>
            </div>
          </div>
          <ul class="manage-list">
            <li v-if="shopInfo.role !== '店主'">
              <a href="./mycode.html">
                <div class="item">
                  <span class="icon code-icon"></span>
                  <div class="txt">
                    我的店长码
                  </div>
                </div>
              </a>
            </li>
            <li v-if="shopInfo.role !== '店主'">
              <a :href="'./order-list.html?shop_id=' + shopInfo.shop_id">
                <div class="item">
                  <span class="icon order-icon"></span>
                  <div class="txt">
                    订单管理
                  </div> 
                  <span class="hand" v-on:click.stop.prevent="handOkHandler(shopInfo.shop_id)">手动核销</span>
                </div>
              </a>
            </li>
            <li>
              <a :href="'./records.html?shop_id=' + shopInfo.shop_id">
                <div class="item">
                  <span class="icon recive-icon"></span>
                  <div class="txt">
                  收入明细
                  </div>
                </div>
              </a>
            </li>
            <li>
              <a :href="'./members.html?shop_id=' + shopInfo.shop_id">
                <div class="item">
                  <span class="icon mem-icon"></span>
                  <div class="txt">
                  人员名单
                  </div>
                </div>
              </a>
            </li>
            <li>
              <a :href="'./tongji.html?shop_id=' + shopInfo.shop_id ">
                <div class="item">
                  <span class="icon data-icon"></span>
                  <div class="txt">
                  数据统计
                  </div>
                </div>
              </a>
            </li>
          </ul>
          <div class="logout-btn"  v-on:click="logoutHanlder">退出登录</div>
      </template>
      
    </div>
    <script type="text/javascript" src="./public/js/lib/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="./public/js/lib/vue.min.js"></script>
    <script type="text/javascript" src="./public/js/src/md5.js"></script>
    <script>
        var links = ['./public/js/src/global.js', './public/js/src/my-shop.js']
        links.forEach(function(item) {
            document.write('<script type="text/javascript" src="' + item +'?ver=' + Math.random() +'"><\/script>')
        })
    </script>
  </body>
</html>